'use strict';

const mongoose = require('mongoose'),
    clientModal = mongoose.model('Client');

module.exports = {
    addClient:addClient,
    getClientByCname:getClientByCname
}

function addClient(client, callback) {
    clientModal.create(client, function(error, data) {
        callback(null,data);
    })
}

function getClientByCname(cname, callback) {
    clientModal.findOne({"cname":cname}, function(error, data) {
        callback(null, data);
    })
}

